//
//  AppDelegate+BaiduMap.m
//  HandheldELearn
//
//  Created by 陈武琦 on 16/9/19.
//  Copyright © 2016年 陈武琦. All rights reserved.
//

#import "AppDelegate+BaiduMap.h"
#import <BaiduMapAPI_Map/BMKMapComponent.h>

@implementation AppDelegate (BaiduMap)
BMKMapManager* _mapManager;
- (void)baiduMap_application {
    
    // 要使用百度地图，请先启动BaiduMapManager
    _mapManager = [[BMKMapManager alloc]init];
    BOOL ret = [_mapManager start:@"KSwxm03ZyUSeGOrqgG3TBiHRVhEE0yPs" generalDelegate:self];
    if (!ret) {
        NSLog(@"manager start failed!");
    }
}


#pragma mark -
#pragma mark Memory management

- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
    /*
     Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
     */
}

- (void)onGetNetworkState:(int)iError
{
    if (0 == iError) {
        NSLog(@"联网成功");
    }
    else{
        NSLog(@"onGetNetworkState %d",iError);
    }
    
}

- (void)onGetPermissionState:(int)iError
{
    if (0 == iError) {
        NSLog(@"授权成功");
    }
    else {
        NSLog(@"onGetPermissionState %d",iError);
    }
}
@end
